import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import "@/assets/css/common.css"
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';
import request from "@/utils/request";
import {dateFormatFun} from "@/utils/dateFormate";

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.prototype.request=request;

Vue.filter("dateFormatFun",function (date,fmtNum) {
    return dateFormatFun(date,fmtNum)
})

// vue自定义setItem方法
Vue.prototype.mySetItem = function (key, newVal) {
    // 创建一个StorageEvent事件
    var newStorageEvent = document.createEvent('StorageEvent');
    const storage = {
        setItem: function (k, val) {
            localStorage.setItem(k, val);
            // 初始化创建的事件
            newStorageEvent.initStorageEvent('setItem', false, false, k, null, val, null);

            // 派发对象
            window.dispatchEvent(newStorageEvent)
        }
    }
    return storage.setItem(key, newVal);
}




new Vue({
  router,
  store,
  el: '#app',
  render: h => h(App)
}).$mount('#app')
